!!****f* ABINIT/contstr26
!! NAME
!! contstr26
!!
!! FUNCTION
!! Carries out specialized metric tensor operations needed for contraction
!! of the 2nd strain derivative of the l=0,1,2,3 nonlocal Kleinman-Bylander
!! pseudopotential operation.  Derivatives are wrt a pair of cartesian
!! strain components.
!! Full advantage is taken of the full permutational symmetry of these
!! tensors.
!!
!! COPYRIGHT
!! Copyright (C) 1998-2020 ABINIT group (DRH)
!! This file is distributed under the terms of the
!! GNU General Public License, see ~abinit/COPYING
!! or http://www.gnu.org/copyleft/gpl.txt .
!! For the initials of contributors, see ~abinit/doc/developers/contributors.txt.
!!
!! INPUTS
!!  istr1=1,...6 specifies cartesian strain component 11,22,33,32,31,21
!!  istr2=seccond strain component
!!  rank=angular momentum
!!  gm(3,3)=metric tensor (array is symmetric but stored as 3x3)
!!  gprimd(3,3)=reciprocal space dimensional primitive translations
!!  aa(2,*)=unique elements of complex right-hand tensor
!!  bb(2,*)=unique elements of complex left-hand tensor
!!
!! OUTPUT
!!  e2nl=contraction for nonlocal 2nd-order strain derivative energy
!!
!! NOTES
!! All tensors are stored in a compressed storage mode defined below;
!! input and output conform to this scheme.
!! When tensor elements occur repeatedly due to symmetry, the
!! WEIGHT IS INCLUDED in the output tensor element to simplify later
!! contractions with other tensors of the same rank and form, i.e. the
!! next contraction is then simply a dot product over the unique elements.
!!
!! PARENTS
!!      nonlop_pl
!!
!! CHILDREN
!!
!! SOURCE

#if defined HAVE_CONFIG_H
#include "config.h"
#endif

#include "abi_common.h"


module m_contstr26
contains
!!**



subroutine contstr26(istr1,istr2,rank,gm,gprimd,e2nl,aa,bb)

 use defs_basis
 use m_abicore
 implicit none

!Arguments ------------------------------------
!scalars
 integer,intent(in) :: istr1,istr2,rank
 real(dp),intent(out) :: e2nl
!arrays
 real(dp),intent(in) :: aa(2,((rank+1)*(rank+2))/2),bb(2,((rank+1)*(rank+2))/2)
 real(dp),intent(in) :: gm(3,3),gprimd(3,3)

!Local variables-------------------------------
!scalars
 integer,parameter :: mrank=3
 integer :: ii,jj,ka,kb,kd,kg
!arrays
 integer,save :: idx(12)=(/1,1,2,2,3,3,3,2,3,1,2,1/)
 real(dp) :: d2gm(3,3),dgm01(3,3),dgm10(3,3),tmp(2)
 real(dp),allocatable :: cm(:,:)

! *************************************************************************
 ABI_ALLOCATE(cm,(((mrank+1)*(mrank+2))/2,((mrank+1)*(mrank+2))/2))

 ka=idx(2*istr1-1);kb=idx(2*istr1);kg=idx(2*istr2-1);kd=idx(2*istr2)

 do ii = 1,3
   dgm01(:,ii)=-(gprimd(ka,:)*gprimd(kb,ii)+gprimd(kb,:)*gprimd(ka,ii))
   dgm10(:,ii)=-(gprimd(kg,:)*gprimd(kd,ii)+gprimd(kd,:)*gprimd(kg,ii))
 end do

 d2gm(:,:)=0.d0
 do ii = 1,3
   if(ka==kg) d2gm(:,ii)=d2gm(:,ii)&
&   +gprimd(kb,:)*gprimd(kd,ii)+gprimd(kd,:)*gprimd(kb,ii)
   if(ka==kd) d2gm(:,ii)=d2gm(:,ii)&
&   +gprimd(kb,:)*gprimd(kg,ii)+gprimd(kg,:)*gprimd(kb,ii)
   if(kb==kg) d2gm(:,ii)=d2gm(:,ii)&
&   +gprimd(ka,:)*gprimd(kd,ii)+gprimd(kd,:)*gprimd(ka,ii)
   if(kb==kd) d2gm(:,ii)=d2gm(:,ii)&
&   +gprimd(ka,:)*gprimd(kg,ii)+gprimd(kg,:)*gprimd(ka,ii)
 end do
 d2gm(:,:)=0.5d0*d2gm(:,:)

!
!The code below was written by a Mathematica program and formatted by
!a combination of editing scripts.  It is not intended to be read
!by human beings, and certainly not to be modified by one.  Conceivably
!it could be shortened somewhat by identifying common subexpressions.
!
 if(rank==0)then
   cm(1,1)=0.0d0
 elseif(rank==1)then
   cm(1,1)=d2gm(1,1)
   cm(2,1)=d2gm(1,2)
   cm(3,1)=d2gm(1,3)
   cm(1,2)=d2gm(1,2)
   cm(2,2)=d2gm(2,2)
   cm(3,2)=d2gm(2,3)
   cm(1,3)=d2gm(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3)+6*gm(1,3)*(dgm01(3,3)&
&   *dgm10(1,3)+dgm01(1,3)*dgm10(3,3))+6*gm(3,3)**2*d2gm(1,1)+3*gm(1,3)&
&   **2*d2gm(3,3)+gm(3,3)*(12*dgm01(3,3)*dgm10(1,1)+6*dgm01(1,3)&
&   *dgm10(1,3)+12*dgm01(1,1)*dgm10(3,3)+6*gm(1,3)*d2gm(1,3)+12*gm(1,1)&
&   *d2gm(3,3))
   cm(4,3)=3*gm(1,3)*dgm01(3,3)*dgm10(1,2)+6*gm(1,3)*dgm01(2,3)&
&   *dgm10(1,3)+3*gm(1,2)*dgm01(3,3)*dgm10(1,3)+6*gm(1,3)*dgm01(1,3)&
&   *dgm10(2,3)+12*gm(1,1)*dgm01(3,3)*dgm10(2,3)+3*gm(1,3)*dgm01(1,2)&
&   *dgm10(3,3)+3*gm(1,2)*dgm01(1,3)*dgm10(3,3)+12*gm(1,1)*dgm01(2,3)&
&   *dgm10(3,3)+3*gm(1,3)**2*d2gm(2,3)+gm(3,3)*(12*dgm01(2,3)*dgm10(1,1)&
&   +3*dgm01(1,3)*dgm10(1,2)+3*dgm01(1,2)*dgm10(1,3)+12*dgm01(1,1)&
&   *dgm10(2,3)+12*gm(2,3)*d2gm(1,1)+3*gm(1,3)*d2gm(1,2)+3*gm(1,2)&
&   *d2gm(1,3)+12*gm(1,1)*d2gm(2,3))+3*gm(1,2)*gm(1,3)*d2gm(3,3)&
&   +gm(2,3)*(12*dgm01(3,3)*dgm10(1,1)+6*dgm01(1,3)*dgm10(1,3)+12*dgm01(1,1)&
&   *dgm10(3,3)+6*gm(1,3)*d2gm(1,3)+12*gm(1,1)*d2gm(3,3))
   cm(5,3)=7.5d0*gm(1,1)*(dgm01(3,3)*dgm10(1,3)+dgm01(1,3)*dgm10(3,3))&
&   +4.5d0*gm(1,3)**2*d2gm(1,3)+7.5d0*gm(3,3)*(dgm01(1,3)*dgm10(1,1)&
&   +dgm01(1,1)*dgm10(1,3)+gm(1,3)*d2gm(1,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gm(1,3)*dgm01(2,2)*dgm10(1,2)+6*gm(1,2)*dgm01(2,3)&
&   *dgm10(1,2)+3*gm(1,2)*dgm01(2,2)*dgm10(1,3)+3*gm(1,3)*dgm01(1,2)&
&   *dgm10(2,2)+3*gm(1,2)*dgm01(1,3)*dgm10(2,2)+12*gm(1,1)*dgm01(2,3)&
&   *dgm10(2,2)+6*gm(1,2)*dgm01(1,2)*dgm10(2,3)+12*gm(1,1)*dgm01(2,2)&
&   *dgm10(2,3)+3*gm(1,2)*gm(1,3)*d2gm(2,2)+gm(2,3)*(12*dgm01(2,2)&
&   *dgm10(1,1)+6*dgm01(1,2)*dgm10(1,2)+12*dgm01(1,1)*dgm10(2,2)&
&   +12*gm(2,2)*d2gm(1,1)+6*gm(1,2)*d2gm(1,2)+12*gm(1,1)*d2gm(2,2))&
&   +3*gm(1,2)**2*d2gm(2,3)+gm(2,2)*(12*dgm01(2,3)*dgm10(1,1)+3*dgm01(1,3)&
&   *dgm10(1,2)+3*dgm01(1,2)*dgm10(1,3)+12*dgm01(1,1)*dgm10(2,3)&
&   +3*gm(1,3)*d2gm(1,2)+3*gm(1,2)*d2gm(1,3)+12*gm(1,1)*d2gm(2,3))
   cm(3,4)=3*gm(1,3)*dgm01(3,3)*dgm10(1,2)+6*gm(1,3)*dgm01(2,3)&
&   *dgm10(1,3)+3*gm(1,2)*dgm01(3,3)*dgm10(1,3)+6*gm(1,3)*dgm01(1,3)&
&   *dgm10(2,3)+12*gm(1,1)*dgm01(3,3)*dgm10(2,3)+3*gm(1,3)*dgm01(1,2)&
&   *dgm10(3,3)+3*gm(1,2)*dgm01(1,3)*dgm10(3,3)+12*gm(1,1)*dgm01(2,3)&
&   *dgm10(3,3)+3*gm(1,3)**2*d2gm(2,3)+gm(3,3)*(12*dgm01(2,3)*dgm10(1,1)&
&   +3*dgm01(1,3)*dgm10(1,2)+3*dgm01(1,2)*dgm10(1,3)+12*dgm01(1,1)&
&   *dgm10(2,3)+12*gm(2,3)*d2gm(1,1)+3*gm(1,3)*d2gm(1,2)+3*gm(1,2)&
&   *d2gm(1,3)+12*gm(1,1)*d2gm(2,3))+3*gm(1,2)*gm(1,3)*d2gm(3,3)&
&   +gm(2,3)*(12*dgm01(3,3)*dgm10(1,1)+6*dgm01(1,3)*dgm10(1,3)+12*dgm01(1,1)&
&   *dgm10(3,3)+6*gm(1,3)*d2gm(1,3)+12*gm(1,1)*d2gm(3,3))
   cm(4,4)=15*gm(2,2)*dgm01(3,3)*dgm10(1,1)-6*gm(1,3)*dgm01(2,3)&
&   *dgm10(1,2)+18*gm(1,2)*dgm01(3,3)*dgm10(1,2)+18*gm(2,2)*dgm01(1,3)&
&   *dgm10(1,3)+18*gm(1,3)*dgm01(2,2)*dgm10(1,3)-6*gm(1,2)*dgm01(2,3)&
&   *dgm10(1,3)+18*gm(1,3)*dgm01(1,3)*dgm10(2,2)+15*gm(1,1)*dgm01(3,3)&
&   *dgm10(2,2)-6*gm(1,3)*dgm01(1,2)*dgm10(2,3)-6*gm(1,2)*dgm01(1,3)&
&   *dgm10(2,3)+18*gm(1,1)*dgm01(2,3)*dgm10(2,3)+15*gm(2,2)*dgm01(1,1)&
&   *dgm10(3,3)+18*gm(1,2)*dgm01(1,2)*dgm10(3,3)+15*gm(1,1)*dgm01(2,2)&
&   *dgm10(3,3)+9*gm(2,3)**2*d2gm(1,1)+18*gm(1,3)*gm(2,2)*d2gm(1,3)&
&   +9*gm(1,3)**2*d2gm(2,2)+gm(3,3)*(15*dgm01(2,2)*dgm10(1,1)+18*dgm01(1,2)&
&   *dgm10(1,2)+15*dgm01(1,1)*dgm10(2,2)+15*gm(2,2)*d2gm(1,1)+18*gm(1,2)&
&   *d2gm(1,2)+15*gm(1,1)*d2gm(2,2))-6*gm(1,2)*gm(1,3)*d2gm(2,3)&
&   +gm(2,3)*(18*dgm01(2,3)*dgm10(1,1)-6*dgm01(1,3)*dgm10(1,2)-6*dgm01(1,2)&
&   *dgm10(1,3)+18*dgm01(1,1)*dgm10(2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gm(1,3)*d2gm(1,1)&
&   +gm(1,1)*d2gm(1,3))+3*gm(1,1)*gm(1,3)*d2gm(2,3)+12*gm(1,1)*gm(1,2)&
&   *d2gm(3,3)
   cm(5,5)=3*gm(1,3)**2*d2gm(1,1)+12*gm(3,3)*(dgm01(1,1)*dgm10(1,1)&
&   +gm(1,1)*d2gm(1,1))+6*gm(1,3)*(dgm01(1,3)*dgm10(1,1)+dgm01(1,1)&
&   *dgm10(1,3)+gm(1,1)*d2gm(1,3))+gm(1,1)*(12*dgm01(3,3)*dgm10(1,1)&
&   +6*dgm01(1,3)*dgm10(1,3)+12*dgm01(1,1)*dgm10(3,3)+6*gm(1,1)*d2gm(3,3))
   cm(6,5)=3*gm(1,2)*dgm01(1,3)*dgm10(1,1)+12*gm(1,1)*dgm01(2,3)&
&   *dgm10(1,1)+3*gm(1,1)*dgm01(1,3)*dgm10(1,2)+3*gm(1,2)*dgm01(1,1)&
&   *dgm10(1,3)+3*gm(1,1)*dgm01(1,2)*dgm10(1,3)+12*gm(1,1)*dgm01(1,1)&
&   *dgm10(2,3)+12*gm(2,3)*(dgm01(1,1)*dgm10(1,1)+gm(1,1)*d2gm(1,1))&
&   +3*gm(1,3)*(dgm01(1,2)*dgm10(1,1)+dgm01(1,1)*dgm10(1,2)+gm(1,2)&
&   *d2gm(1,1)+gm(1,1)*d2gm(1,2))+3*gm(1,1)*gm(1,2)*d2gm(1,3)+6*gm(1,1)&
&   **2*d2gm(2,3)
   cm(7,5)=(-36*gm(1,3)*dgm01(2,2)*dgm10(1,2)+180*gm(1,2)*dgm01(2,3)&
&   *dgm10(1,2)-36*gm(1,2)*dgm01(2,2)*dgm10(1,3)-36*gm(1,3)*dgm01(1,2)&
&   *dgm10(2,2)-36*gm(1,2)*dgm01(1,3)*dgm10(2,2)-18*gm(1,1)*dgm01(2,3)&
&   *dgm10(2,2)+180*gm(1,2)*dgm01(1,2)*dgm10(2,3)-18*gm(1,1)*dgm01(2,2)&
&   *dgm10(2,3)-36*gm(1,2)*gm(1,3)*d2gm(2,2)+gm(2,3)*(-18*dgm01(2,2)&
&   *dgm10(1,1)+180*dgm01(1,2)*dgm10(1,2)-18*dgm01(1,1)*dgm10(2,2)&
&   -18*gm(2,2)*d2gm(1,1)+180*gm(1,2)*d2gm(1,2)-18*gm(1,1)*d2gm(2,2))&
&   +90*gm(1,2)**2*d2gm(2,3)+gm(2,2)*(-18*dgm01(2,3)*dgm10(1,1)-36*dgm01(1,3)&
&   *dgm10(1,2)-36*dgm01(1,2)*dgm10(1,3)-18*dgm01(1,1)*dgm10(2,3)&
&   -36*gm(1,3)*d2gm(1,2)-36*gm(1,2)*d2gm(1,3)-18*gm(1,1)*d2gm(2,3)))&
&   /12.d0
   cm(8,5)=12*gm(1,3)*dgm01(3,3)*dgm10(1,2)+3*gm(1,3)*dgm01(2,3)&
&   *dgm10(1,3)+12*gm(1,2)*dgm01(3,3)*dgm10(1,3)+3*gm(1,3)*dgm01(1,3)&
&   *dgm10(2,3)-4.5d0*gm(1,1)*dgm01(3,3)*dgm10(2,3)+12*gm(1,3)*dgm01(1,2)&
&   *dgm10(3,3)+12*gm(1,2)*dgm01(1,3)*dgm10(3,3)-4.5d0*gm(1,1)*dgm01(2,3)&
&   *dgm10(3,3)+1.5d0*gm(1,3)**2*d2gm(2,3)+gm(3,3)*(-4.5d0*dgm01(2,3)&
&   *dgm10(1,1)+12*dgm01(1,3)*dgm10(1,2)+12*dgm01(1,2)*dgm10(1,3)&
&   -4.5d0*dgm01(1,1)*dgm10(2,3)-4.5d0*gm(2,3)*d2gm(1,1)+12*gm(1,3)&
&   *d2gm(1,2)+12*gm(1,2)*d2gm(1,3)-4.5d0*gm(1,1)*d2gm(2,3))+12*gm(1,2)&
&   *gm(1,3)*d2gm(3,3)+gm(2,3)*(-4.5d0*dgm01(3,3)*dgm10(1,1)+3*dgm01(1,3)&
&   *dgm10(1,3)-4.5d0*dgm01(1,1)*dgm10(3,3)+3*gm(1,3)*d2gm(1,3)-4.5d0*g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)-4.5d0*gm(1,1)*dgm01(2,3)&
&   *dgm10(2,2)+3*gm(1,2)*dgm01(1,2)*dgm10(2,3)-4.5d0*gm(1,1)*dgm01(2,2)&
&   *dgm10(2,3)+12*gm(1,2)*gm(1,3)*d2gm(2,2)+gm(2,3)*(-4.5d0*dgm01(2,2)&
&   *dgm10(1,1)+3*dgm01(1,2)*dgm10(1,2)-4.5d0*dgm01(1,1)*dgm10(2,2)&
&   -4.5d0*gm(2,2)*d2gm(1,1)+3*gm(1,2)*d2gm(1,2)-4.5d0*gm(1,1)*d2gm(2,2))&
&   +1.5d0*gm(1,2)**2*d2gm(2,3)+gm(2,2)*(-4.5d0*dgm01(2,3)*dgm10(1,1)&
&   +12*dgm01(1,3)*dgm10(1,2)+12*dgm01(1,2)*dgm10(1,3)-4.5d0*dgm01(1,1)&
&   *dgm10(2,3)+12*gm(1,3)*d2gm(1,2)+12*gm(1,2)*d2gm(1,3)-4.5d0*gm(1,1)&
&   *d2gm(2,3))
   cm(10,6)=(-36*gm(1,3)*dgm01(3,3)*dgm10(1,2)+180*gm(1,3)*dgm01(2,3)&
&   *dgm10(1,3)-36*gm(1,2)*dgm01(3,3)*dgm10(1,3)+180*gm(1,3)*dgm01(1,3)&
&   *dgm10(2,3)-18*gm(1,1)*dgm01(3,3)*dgm10(2,3)-36*gm(1,3)*dgm01(1,2)&
&   *dgm10(3,3)-36*gm(1,2)*dgm01(1,3)*dgm10(3,3)-18*gm(1,1)*dgm01(2,3)&
&   *dgm10(3,3)+90*gm(1,3)**2*d2gm(2,3)+gm(3,3)*(-18*dgm01(2,3)*dgm10(1,1)&
&   -36*dgm01(1,3)*dgm10(1,2)-36*dgm01(1,2)*dgm10(1,3)-18*dgm01(1,1)&
&   *dgm10(2,3)-18*gm(2,3)*d2gm(1,1)-36*gm(1,3)*d2gm(1,2)-36*gm(1,2)&
&   *d2gm(1,3)-18*gm(1,1)*d2gm(2,3))-36*gm(1,2)*gm(1,3)*d2gm(3,3)&
&   +gm(2,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3*gm(3,3)**2*d2gm(2,3)&
&   +6*gm(3,3)*(dgm01(3,3)*dgm10(2,3)+dgm01(2,3)*dgm10(3,3)+gm(2,3)&
&   *d2gm(3,3))
   cm(1,9)=(-18*gm(1,3)*dgm01(2,2)*dgm10(1,1)-36*gm(1,2)*dgm01(2,3)&
&   *dgm10(1,1)+180*gm(1,3)*dgm01(1,2)*dgm10(1,2)+180*gm(1,2)*dgm01(1,3)&
&   *dgm10(1,2)-36*gm(1,1)*dgm01(2,3)*dgm10(1,2)+180*gm(1,2)*dgm01(1,2)&
&   *dgm10(1,3)-18*gm(1,1)*dgm01(2,2)*dgm10(1,3)-18*gm(1,3)*dgm01(1,1)&
&   *dgm10(2,2)-18*gm(1,1)*dgm01(1,3)*dgm10(2,2)-36*gm(1,2)*dgm01(1,1)&
&   *dgm10(2,3)-36*gm(1,1)*dgm01(1,2)*dgm10(2,3)+180*gm(1,2)*gm(1,3)&
&   *d2gm(1,2)-36*gm(2,3)*(dgm01(1,2)*dgm10(1,1)+dgm01(1,1)*dgm10(1,2)&
&   +gm(1,2)*d2gm(1,1)+gm(1,1)*d2gm(1,2))+90*gm(1,2)**2*d2gm(1,3)&
&   -18*gm(2,2)*(dgm01(1,3)*dgm10(1,1)+dgm01(1,1)*dgm10(1,3)+gm(1,3)&
&   *d2gm(1,1)+gm(1,1)*d2gm(1,3))-18*gm(1,1)*gm(1,3)*d2gm(2,2)-36*gm(1,1)&
&   *gm(1,2)*d2gm(2,3))/12.d0
   cm(2,9)=12*gm(1,3)*dgm01(2,2)*dgm10(2,2)+3*gm(1,2)*dgm01(2,3)&
&   *dgm10(2,2)+3*gm(1,2)*dgm01(2,2)*dgm10(2,3)+6*gm(2,2)**2*d2gm(1,3)&
&   +3*gm(2,3)*(dgm01(2,2)*dgm10(1,2)+dgm01(1,2)*dgm10(2,2)+gm(2,2)&
&   *d2gm(1,2)+gm(1,2)*d2gm(2,2))+gm(2,2)*(3*dgm01(2,3)*dgm10(1,2)&
&   +12*dgm01(2,2)*dgm10(1,3)+12*dgm01(1,3)*dgm10(2,2)+3*dgm01(1,2)&
&   *dgm10(2,3)+12*gm(1,3)*d2gm(2,2)+3*gm(1,2)*d2gm(2,3))
   cm(3,9)=-4.5d0*gm(2,2)*dgm01(3,3)*dgm10(1,3)-4.5d0*gm(1,3)*dgm01(3,3)&
&   *dgm10(2,2)+3*gm(1,3)*dgm01(2,3)*dgm10(2,3)+12*gm(1,2)*dgm01(3,3)&
&   *dgm10(2,3)-4.5d0*gm(2,2)*dgm01(1,3)*dgm10(3,3)-4.5d0*gm(1,3)&
&   *dgm01(2,2)*dgm10(3,3)+12*gm(1,2)*dgm01(2,3)*dgm10(3,3)+1.5d0*gm(2,3)&
&   **2*d2gm(1,3)+gm(3,3)*(12*dgm01(2,3)*dgm10(1,2)-4.5d0*dgm01(2,2)&
&   *dgm10(1,3)-4.5d0*dgm01(1,3)*dgm10(2,2)+12*dgm01(1,2)*dgm10(2,3)&
&   +12*gm(2,3)*d2gm(1,2)-4.5d0*gm(2,2)*d2gm(1,3)-4.5d0*gm(1,3)*d2gm(2,2)&
&   +12*gm(1,2)*d2gm(2,3))-4.5d0*gm(1,3)*gm(2,2)*d2gm(3,3)+gm(2,3)&
&   *(12*dgm01(3,3)*dgm10(1,2)+3*dgm01(2,3)*dgm10(1,3)+3*dgm01(1,3)&
&   *dgm10(2,3)+12*dgm01(1,2)*dgm10(3,3)+3*gm(1,3)*d2gm(2,3)+12*gm(1,2)&
&   *d2gm(3,3))
   cm(4,9)=12*gm(2,2)*dgm01(3,3)*dgm10(1,2)+3*gm(2,2)*dgm01(2,3)&
&   *dgm10(1,3)+3*gm(1,3)*dgm01(2,3)*dgm10(2,2)+12*gm(1,2)*dgm01(3,3)&
&   *dgm10(2,2)+3*gm(2,2)*dgm01(1,3)*dgm10(2,3)+3*gm(1,3)*dgm01(2,2)&
&   *dgm10(2,3)+6*gm(1,2)*dgm01(2,3)*dgm10(2,3)+12*gm(2,2)*dgm01(1,2)&
&   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m01(2,2)*dgm10(2,2)+gm(2,2)*d2gm(2,2))&
&   +gm(2,2)*(6*dgm01(2,3)*dgm10(2,2)+6*dgm01(2,2)*dgm10(2,3)+3*gm(2,2)&
&   *d2gm(2,3))
   cm(8,9)=7.5d0*gm(2,2)*(dgm01(3,3)*dgm10(2,3)+dgm01(2,3)*dgm10(3,3))&
&   +4.5d0*gm(2,3)**2*d2gm(2,3)+7.5d0*gm(3,3)*(dgm01(2,3)*dgm10(2,2)&
&   +dgm01(2,2)*dgm10(2,3)+gm(2,3)*d2gm(2,2)+gm(2,2)*d2gm(2,3))+gm(2,3)&
&   *(7.5d0*dgm01(3,3)*dgm10(2,2)+9*dgm01(2,3)*dgm10(2,3)+7.5d0*dgm01(2,2)&
&   *dgm10(3,3)+7.5d0*gm(2,2)*d2gm(3,3))
   cm(9,9)=3*gm(2,3)**2*d2gm(2,2)+12*gm(3,3)*(dgm01(2,2)*dgm10(2,2)&
&   +gm(2,2)*d2gm(2,2))+6*gm(2,3)*(dgm01(2,3)*dgm10(2,2)+dgm01(2,2)&
&   *dgm10(2,3)+gm(2,2)*d2gm(2,3))+gm(2,2)*(12*dgm01(3,3)*dgm10(2,2)&
&   +6*dgm01(2,3)*dgm10(2,3)+12*dgm01(2,2)*dgm10(3,3)+6*gm(2,2)*d2gm(3,3))
   cm(10,9)=-3*gm(2,2)*dgm01(3,3)*dgm10(3,3)+9*gm(2,3)*(dgm01(3,3)&
&   *dgm10(2,3)+dgm01(2,3)*dgm10(3,3))-1.5d0*gm(3,3)**2*d2gm(2,2)&
&   +4.5d0*gm(2,3)**2*d2gm(3,3)+gm(3,3)*(-3*dgm01(3,3)*dgm10(2,2)&
&   +9*dgm01(2,3)*dgm10(2,3)-3*dgm01(2,2)*dgm10(3,3)+9*gm(2,3)*d2gm(2,3)&
&   -3*gm(2,2)*d2gm(3,3))
   cm(1,10)=-1.5d0*gm(1,1)*(dgm01(3,3)*dgm10(1,3)+dgm01(1,3)*dgm10(3,3))&
&   +7.5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))
   cm(10,10)=gm(3,3)*(6*dgm01(3,3)*dgm10(3,3)+3*gm(3,3)*d2gm(3,3))


 end if
!
!contraction to output scalar
!
 e2nl=0.d0
 do jj=1,((rank+1)*(rank+2))/2
   tmp(:)=0.d0
   do ii=1,((rank+1)*(rank+2))/2
     tmp(:)=tmp(:)+aa(:,ii)*cm(ii,jj)
   end do
   e2nl=e2nl+tmp(1)*bb(1,jj)+tmp(2)*bb(2,jj)
 end do

 ABI_DEALLOCATE(cm)

end subroutine contstr26
!!***

end module m_contstr26
!!***
